package com.sxygsj.android.personnelscreen.plugin_jiguang.userInfoList;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.Objects;

public class UserInfo implements Parcelable, Serializable {
    private String ImageUrl;
    private String PersonName;
    private String WorkType;
    private String Department;
    private String CardNumber;
    private long createTime;

    public UserInfo(String imageUrl, String personName, String workType, String department, String cardNumber, long createTime) {
        ImageUrl = imageUrl;
        PersonName = personName;
        WorkType = workType;
        Department = department;
        CardNumber = cardNumber;
        this.createTime = createTime;
    }

    public String getImageUrl() {
        return ImageUrl;
    }

    public void setImageUrl(String imageUrl) {
        ImageUrl = imageUrl;
    }

    public String getPersonName() {
        return PersonName;
    }

    public void setPersonName(String personName) {
        PersonName = personName;
    }

    public String getWorkType() {
        return WorkType;
    }

    public void setWorkType(String workType) {
        WorkType = workType;
    }

    public String getDepartment() {
        return Department;
    }

    public void setDepartment(String department) {
        Department = department;
    }

    public String getCardNumber() {
        return CardNumber;
    }

    public void setCardNumber(String cardNumber) {
        CardNumber = cardNumber;
    }

    protected UserInfo(Parcel in) {
        ImageUrl = in.readString();
        PersonName = in.readString();
        WorkType = in.readString();
        Department = in.readString();
        CardNumber = in.readString();
        createTime = in.readLong();
    }

    public static final Creator<UserInfo> CREATOR = new Creator<UserInfo>() {
        @Override
        public UserInfo createFromParcel(Parcel in) {
            return new UserInfo(in);
        }

        @Override
        public UserInfo[] newArray(int size) {
            return new UserInfo[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(ImageUrl);
        parcel.writeString(PersonName);
        parcel.writeString(WorkType);
        parcel.writeString(Department);
        parcel.writeString(CardNumber);
        parcel.writeLong(createTime);
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "ImageUrl='" + ImageUrl + '\'' +
                ", PersonName='" + PersonName + '\'' +
                ", WorkType='" + WorkType + '\'' +
                ", Department='" + Department + '\'' +
                ", CardNumber='" + CardNumber + '\'' +
                ", createTime=" + createTime +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserInfo info = (UserInfo) o;
        return createTime == info.createTime && ImageUrl.equals(info.ImageUrl) && PersonName.equals(info.PersonName) && WorkType.equals(info.WorkType) && Department.equals(info.Department) && CardNumber.equals(info.CardNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ImageUrl, PersonName, WorkType, Department, CardNumber, createTime);
    }
}
